<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1 = new Promise((resolve,reject)=>{
            console.log(1);
            try{
                // 手动抛出错误
            //    throw new Error('error')
               //使用定时器模拟ajax请求
               setTimeout(() => {
                console.log(2);
                // resolve(3)
                reject(3)
               }, 3000);
            }catch(e){
                console.log(e);
                console.log(e.message);

            }
        })
        console.log(p1);
    </script>
</body>
</html>